package org.example.gxpt.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.gxpt.pojo.entity.UserRole;

@Mapper
public interface UserRoleMapper {

    void insert(UserRole userRole);

    void update(UserRole userRole);

    @Delete("delete from user_role where role_id = #{roleId} and role = #{role}")
    void delete(UserRole userRole);

    @Select("select * from user_role where username = #{username}")
    UserRole selectByUsername(String username);

    @Select("select * from user_role where phone = #{phone}")
    UserRole selectByPhone(String phone);

}
